{% extends 'BWLwebshopBundle:Admin:orderTracking.html.twig' %}

{% block title %}Auftragsverfolgung{% endblock %}

{% block body %}
    <form action="{{ path('bwl_webshop_orderTracking') }}"
          method="post" {{ form_enctype(form) }}>
        {{ form_widget(form) }}
        <input type="submit" value="OK"/>
    </form>
    <hr/>
    {% if (form.vars.value.from|date('d.m.Y') > form.vars.value.to|date('d.m.Y') or form.vars.value.to|date('d.m.Y') > "now"|date("d/m/Y")) %}
        <p>Zeitspanne ungültig</p>
    {% else %}
        <article class="box">
            <header><h3>Vom: {{ form.vars.value.from|date('d.m.Y') }}
                Bis: {{ form.vars.value.to|date('d.m.Y') }}</h3></h2></header>
            <h1>Bedarf</h1>
            <table class="dottedlight">
                <tr>
                    <th>Produkte</th>
                    <th>Tag</th>
                    <th>Menge</th>
                </tr>
                {% for item in requirements %}
                    <tr>
                        <td>{{ item.name }}</td>
                        <td>{{ item.orderDate}}</td>
                        <td style="text-align: right"> {{ item.countSum }}</td>
                    </tr>
                {% endfor %}
            </table>

            <br/>

            <h1>Auftrag</h1>
            <table class="dottedlight">
                <tr>
                    <th>Produkte</th>
                    <th>Tag</th>
                    <th>Menge</th>
                </tr>

            </table>

            <br/>

            <h1>Bedarfsdeckung</h1>
            <table class="dottedlight">
                <tr>
                    <th>Produkte</th>
                    <th>Bedarfstag</th>
                    <th>Auftragstag</th>
                    <th>Menge</th>
                </tr>

                <tr>
                    <td>A</td>
                    <td>B</td>
                    <td>C</td>
                </tr>

            </table>

            <br/>

            <h1>Bedarfsableitung</h1>
            <table class="dottedlight">
                <tr>
                    <th>Oberteil</th>
                    <th>Unterteil</th>
                    <th>Auftragstag</th>
                    <th>Bedarfstag</th>
                    <th>Menge Unterteil</th>
                </tr>

                <tr>
                    <td>A</td>
                    <td>B</td>
                    <td>C</td>
                    <td>D</td>
                    <td>E</td>
                </tr>

            </table>

        </article>
    {% endif %}
{% endblock %}